
function basicdata(hospitalVisit){
	var inHospitalDateTime=hospitalVisit.inHospitalDateTime;
	var outHospitalDateTime=hospitalVisit.outHospitalDateTime;
	var intime=getymd(inHospitalDateTime);
	var outtime=getymd(outHospitalDateTime);
	$("#medicalInsuranceNumber").html(hospitalVisit.medicalInsuranceNumber);
	$("#visitNumber").html(hospitalVisit.visitNumber);
	$("#mrId").html(hospitalVisit.mrId);
	$("#medicalPayTypeName").html(hospitalVisit.medicalPayTypeName);
	$("#patientName").html(hospitalVisit.patientName);
	$("#sexName").html(hospitalVisit.sexName);
	$("#birthday").html(hospitalVisit.birthday);
	$("#age").html(hospitalVisit.age);
	$("#marriageName").html(hospitalVisit.marriageName);
	$("#professionName").html(hospitalVisit.professionName);
	$("#birthAddress").html(hospitalVisit.birthAddress);
	$("#nationName").html(hospitalVisit.nationName);
	$("#nationalityName").html(hospitalVisit.nationalityName);
	$("#idNumber").html(hospitalVisit.idNumber);
	$("#workUnitName").html(hospitalVisit.workUnitName);
	$("#workUnitAddress").html(hospitalVisit.workUnitAddress);
	$("#workUnitPhone").html(hospitalVisit.workUnitPhone);
	$("#workUnitPostCode").html(hospitalVisit.workUnitPostCode);
	$("#permanentAddress").html(hospitalVisit.permanentAddress);
	$("#permanentAddressPostCode").html(hospitalVisit.permanentAddressPostCode);
	$("#linkManName").html(hospitalVisit.linkManName);
	$("#linkManRelativeRelationName").html(hospitalVisit.linkManRelativeRelationName);
	$("#linkManPhone").html(hospitalVisit.linkManPhone);
	$("#linkManAddress").html(hospitalVisit.linkManAddress);
	$("#inHospitalTypeName").html(hospitalVisit.inHospitalTypeName);
	$("#inHospitalStateName").html(hospitalVisit.inHospitalStateName);
	$("#clinicalReceptionDateTime").html(hospitalVisit.clinicalReceptionDateTime);
	$("#responsiblePersonName").html(hospitalVisit.responsiblePersonName);
	$("#inHospitalDateTime").html(intime);
	$("#inDeptName").html(hospitalVisit.inDeptName);
	$("#outHospitalDateTime").html(outtime);
	$("#outDeptName").html(hospitalVisit.outDeptName);
}
	function getymd(dateStr) {
		if(dateStr=="" || dateStr==undefined){
			return;
		}
	     var date = new Date(Date.parse(dateStr.replace(/-/g, "/")));
	     var mm = date.getMonth() + 1;
	     //月
	    var dd = date.getDate();
	     //日
	    var yy = date.getFullYear();
	     //年
	    var h = date.getHours(); 
	   	return yy+"年"+mm+"月"+dd+"日&nbsp;"+h+"时";
	 } 
	function personnelCategory(hospitalVisit){
		$("#personnelCategoryName").html(hospitalVisit.personnelCategoryName);
		$("#majorUnitName").html(hospitalVisit.majorUnitName);
		$("#troopServiceName").html(hospitalVisit.troopServiceName);
		$("#medicalSystemName").html(hospitalVisit.medicalSystemName);
		$("#idTypeName").html(hospitalVisit.idTypeName);
		$("#costTypeName").html(hospitalVisit.costTypeName);
		$("#jobStateName").html(hospitalVisit.jobStateName);
		$("#militaryTrainingInjuryName").html(hospitalVisit.militaryTrainingInjuryName);
		$("#diagConfirmedDateTime").html(hospitalVisit.diagConfirmedDateTime);
		$("#diagConfirmedDayNumber").html(hospitalVisit.diagConfirmedDayNumber);
		$("#inHospitalDayNumber").html(hospitalVisit.inHospitalDayNumber);
	}
	function cureInfo(data){
		$("#bloodTypeCode").html(data.bloodTypeCode);
		$("#rhBloodTypeCode").html(data.rhBloodTypeCode);
	}
	
	function diagAccordRecords(data){
		var diags=data.diagAccordRecords;
		for(var index in diags){
			var diag = diags[index];
			if( diag.diagCompareName.indexOf("门诊和出院") >=0){
				$("#accord0").html(diag.diagAccordCode);
			}
			if( diag.diagCompareName.indexOf("入院和出院") >=0){
				$("#accord1").html(diag.diagAccordCode);
			}
			if( diag.diagCompareName.indexOf("术前和术后") >=0){
				$("#accord2").html(diag.diagAccordCode);
			}
			if( diag.diagCompareName.indexOf("临床与病理") >=0){
				$("#accord3").html(diag.diagAccordCode);
			}
			if( diag.diagCompareName.indexOf("放射和病理") >=0){
				$("#accord4").html(diag.diagAccordCode);
			}
		
		}
	}
	
	function costRecords(data){
		var costs=data.costRecords;
		var money=0;
		for(var index in costs){
			var cost=costs[index];
			if(cost.medicalCostTypeName.indexOf("床位")>=0){
				$("#costMoney1").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("西药")>=0){
				$("#costMoney2").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("中药")>=0){
				$("#costMoney3").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("检验")>=0){
				$("#costMoney4").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("放射")>=0){
				$("#costMoney5").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("特检")>=0){
				$("#costMoney6").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("治疗")>=0){
				$("#costMoney7").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("输血")>=0){
				$("#costMoney8").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("手术")>=0){
				$("#costMoney9").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("护理")>=0){
				$("#costMoney10").html(cost.costMoney);
				money=money+cost.costMoney;
			}
			if(cost.medicalCostTypeName.indexOf("其他")>=0){
				$("#costMoney11").html(cost.costMoney);
				money=money+cost.costMoney;
			}
		}
			if(money>0){
				$("#costMoney0").html(money);
			}
	}
	
	function infusionBloodInfo(data){
		$("#infusionBloodTimes").html(data.infusionBloodTimes);
		$("#infusionBloodReactTimes").html(data.infusionBloodReactTimes);
	}
	
	function cureWorkers(data){
		var cureWorkers=data.cureWorkers;
		for(var index in cureWorkers){
			var cureWorker=cureWorkers[index];
			if(cureWorker.professionTitleName.indexOf("科主任")>=0){
				$("#cureWorkers0").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("主(副主)任医师")>=0){
				$("#cureWorkers1").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("主治医生")>=0){
				$("#cureWorkers2").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("住院医师")>=0){
				$("#cureWorkers3").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("进修医师")>=0){
				$("#cureWorkers4").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("研究生实习医师")>=0){
				$("#cureWorkers5").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("实习医师")>=0){
				$("#cureWorkers6").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("编码员")>=0){
				$("#cureWorkers7").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("质控医师")>=0){
				$("#cureWorkers8").html(cureWorker.medicalWorkerName);
			}
			if(cureWorker.professionTitleName.indexOf("质控护士")>=0){
				$("#cureWorkers9").html(cureWorker.medicalWorkerName);
			}
		}
		
	}
	
	function operateInfo(data){
		var operateRecords=data;
		var html="";
		for(var index in operateRecords){
			var operateRecord=operateRecords[index];
			var operateWorker=operateRecord.operateWorkers[index];
			if(operateRecord.operateStartDate=="" || operateRecord.operateStartDate==null){
				operateRecord.operateStartDate="";
			}
			html=html+"<tr>"+
						"<td style='height: 50px' align='center'>"+
						"<label><span id=''>"+operateRecord.operateStartDate.substring(0,10)+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateWorkers[1].medicalWorkerName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateWorkers[2].medicalWorkerName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateWorkers[3].medicalWorkerName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.anaesthesiaTypeName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.cicatrizeTypeName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateWorkers[0].medicalWorkerName+"</span></label>"+
						"</td>"+
						"<td style='height: 50px' align='center'>"+
							"<label><span id=''>"+operateRecord.operateCode+"</span></label>"+
						"</td>"+
					 "</tr>";
		}
		$("#operateRecords").html(html);
	}
	
	function diseaseDiagRecords(data){
		var diseaseDiagRecords=data.diseaseDiagRecords;
		var num=0;
		var tbodyHtml="";
		for(var index in diseaseDiagRecords){
			var diseaseDiagRecord=diseaseDiagRecords[index];
			if(diseaseDiagRecord.confirmedDateTime=="" || diseaseDiagRecord.confirmedDateTime==null){
				diseaseDiagRecord.confirmedDateTime="";
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("门诊诊断")>=0){
				$("#diseaseDiagName0").html(diseaseDiagRecord.diseaseDiagName);
				$("#diseaseDiagCode0").html(diseaseDiagRecord.diseaseDiagCode);
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("主要诊断")>=0){
				$("#diseaseDiagName1").html(diseaseDiagRecord.diseaseDiagName);
				$("#confirmedDateTime1").html(diseaseDiagRecord.confirmedDateTime.substring(0,10));
				$("#treatResultName1").html(diseaseDiagRecord.treatResultName);
				$("#treatDayNumber1").html(diseaseDiagRecord.treatDayNumber);
				$("#diseaseDiagCode1").html(diseaseDiagRecord.diseaseDiagCode);
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("入院初步诊断")>=0){
				$("#diseaseDiagName2").html(diseaseDiagRecord.diseaseDiagName);
				$("#diseaseDiagCode2").html(diseaseDiagRecord.diseaseDiagCode);
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("次要诊断")>=0){
				if(num == 0){
					tbodyHtml=tbodyHtml+"<tr>"+
						"<td width='510'>"+
							"<label style='width: 320px;'>其他诊断&nbsp;<span id='diseaseDiagName3'>"+diseaseDiagRecord.diseaseDiagName+"</span></label>"+
						"</td>"+
						"<td width='90' align='center'>"+
							"<label style='width: 79px;'><span id='confirmedDateTime3'>"+diseaseDiagRecord.confirmedDateTime.substring(0,10)+"</span></label>"+
						"</td>"+
						"<td width='22'>"+
							"<label style='width: 35px;'><span id='treatResultName3'>"+diseaseDiagRecord.treatResultName+"</span></label>"+
						"</td>"+
						"<td width='22' align='center'>"+
							"<label style='width: 35px;'><span id='treatResultCode3'>"+diseaseDiagRecord.treatDayNumber+"</span></label>"+
						"</td>"+
						"<td width='70' align='center'>"+
							"<label style='width: 60px;'><span id='diseaseDiagCode3'>"+diseaseDiagRecord.diseaseDiagCode+"</span></label>"+
						"</td>"+
					"</tr>";
				}else{
					tbodyHtml=tbodyHtml+"<tr>"+
						"<td>"+
							"<label style='width: 320px;'>&emsp;&emsp;&emsp;&emsp;&nbsp;<span id=''>"+diseaseDiagRecord.diseaseDiagName+"</span></label>"+
						"</td>"+
						"<td align='center'>"+
							"<label style='width: 79px;'><span id=''>"+diseaseDiagRecord.confirmedDateTime.substring(0,10)+"</span></label>"+
						"</td>"+
						"<td>"+
							"<label style='width: 35px;'><span id=''>"+diseaseDiagRecord.treatResultName+"</span></label>"+
						"</td>"+
						"<td align='center'>"+
							"<label style='width: 35px;'><span id=''>"+diseaseDiagRecord.treatDayNumber+"</span></label>"+
						"</td>"+
						"<td align='center'>"+
							"<label style='width: 60px;'><span id=''>"+diseaseDiagRecord.diseaseDiagCode+"</span></label>"+
						"</td>"+
					"</tr>";
				}
				num=num+1;
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("损伤、中毒的外部原因")>=0){
				$("#diseaseDiagName4").html(diseaseDiagRecord.diseaseDiagName);
				$("#diseaseDiagCode4").html(diseaseDiagRecord.diseaseDiagCode);
			}
			if(diseaseDiagRecord.diagTypeName.indexOf("根本死亡原因")>=0){
				$("#diseaseDiagName5").html(diseaseDiagRecord.diseaseDiagName);
				$("#diseaseDiagCode5").html(diseaseDiagRecord.diseaseDiagCode);
			}
		}
		tbodyHtml=tbodyHtml+"<tr>"+
								"<td>"+
									"<label style='width: 320px;'>&emsp;&emsp;&emsp;&emsp;&nbsp;<span id=''></span></label>"+
								"</td>"+
								"<td align='center'>"+
									"<label style='width: 79px;'><span id=''></span></label>"+
								"</td>"+
								"<td>"+
									"<label style='width: 35px;'><span id=''></span></label>"+
								"</td>"+
								"<td align='center'>"+
									"<label style='width: 35px;'><span id=''></span></label>"+
								"</td>"+
								"<td align='center'>"+
									"<label style='width: 60px;'><span id=''></span></label>"+
								"</td>"+
							"</tr>";
		$("#secondarydiagnosis").html(tbodyHtml);
		
	}
	
	//临时医嘱单
	function doctorAdviceTemporaryInfo(data){
		console.log(data);
		var doctorAdviceTemporaryRecords="";
		if(data.doctorAdviceTemporaryRecords==undefined){
			return;
		}else{
			doctorAdviceTemporaryRecords=data.doctorAdviceTemporaryRecords;
		}
		
		var num=0;
		for(var index in doctorAdviceTemporaryRecords){
			num++;
			var doctorAdviceTemporaryRecord=doctorAdviceTemporaryRecords[index];
			var doctorAdviceTemporaryModel=$("#doctorAdviceTemporaryModel").clone();
			doctorAdviceTemporaryModel.removeAttr("id");
			doctorAdviceTemporaryModel.removeAttr("hidden");
			doctorAdviceTemporaryModel.find(".patientId").html(doctorAdviceTemporaryRecord.patientId);
			doctorAdviceTemporaryModel.find(".patientName").html(doctorAdviceTemporaryRecord.patientName);
			doctorAdviceTemporaryModel.find(".deptName").html(doctorAdviceTemporaryRecord.deptName);
			doctorAdviceTemporaryModel.find(".bedName").html(doctorAdviceTemporaryRecord.bedName);
			doctorAdviceTemporaryModel.find(".mrId").html(doctorAdviceTemporaryRecord.mrId);
			doctorAdviceTemporaryModel.find(".indexNumber").html(num);
			var doctorAdviceTemporaryItems=doctorAdviceTemporaryRecord.doctorAdviceTemporaryItems;
			var doctorAdviceTemporaryTable=doctorAdviceTemporaryModel.find("#doctorAdviceTemporaryTable");
			doctorAdviceTemporaryTable.removeAttr("id");
			for(var itemsIndex in doctorAdviceTemporaryItems){
				var doctorAdviceTemporaryItem=doctorAdviceTemporaryItems[itemsIndex];
				var doctorAdviceContent=doctorAdviceTemporaryTable.find("#doctorAdviceContent").clone();
				doctorAdviceContent.removeAttr("hidden");
				doctorAdviceContent.removeAttr("id");
				if(doctorAdviceTemporaryItem.presupposeDateTime=="" || doctorAdviceTemporaryItem.presupposeDateTime==null || doctorAdviceTemporaryItem.presupposeDateTime==undefined){
					doctorAdviceContent.find(".presupposeDateTimeymd").html("");
					doctorAdviceContent.find(".presupposeDateTimehms").html("");
				}else{
					doctorAdviceContent.find(".presupposeDateTimeymd").html(doctorAdviceTemporaryItem.presupposeDateTime.substring(2,10));
					doctorAdviceContent.find(".presupposeDateTimehms").html(doctorAdviceTemporaryItem.presupposeDateTime.substring(11,16));
				}
				
				doctorAdviceContent.find(".doctorAdviceContent").html(doctorAdviceTemporaryItem.doctorAdviceContent);
				doctorAdviceContent.find(".doctorName").html(doctorAdviceTemporaryItem.doctorName);
				doctorAdviceContent.find(".nurseName").html(doctorAdviceTemporaryItem.nurseName);
				if(doctorAdviceTemporaryItem.executionDateTime=="" || doctorAdviceTemporaryItem.executionDateTime==null || doctorAdviceTemporaryItem.executionDateTime==undefined){
					doctorAdviceContent.find(".executionDateTime").html("");
				}else{
					doctorAdviceContent.find(".executionDateTime").html(doctorAdviceTemporaryItem.executionDateTime.substring(12,16));
				}
				doctorAdviceTemporaryTable.find("tbody").append(doctorAdviceContent);
			}
			
			$("#doctorAdviceTemporaryInfo").append(doctorAdviceTemporaryModel);
			
			}
	}
	
	//长期医嘱单
	function doctorAdviceStandingInfo(data){
		console.log(data);
		var doctorAdviceStandingRecords=data.doctorAdviceStandingRecords;
		var num=0;
		for(var index in doctorAdviceStandingRecords){
			num++;
			var doctorAdviceStandingRecord=doctorAdviceStandingRecords[index];
			var longTermDoctorListModel=$("#longTermDoctorListModel").clone();
			longTermDoctorListModel.removeAttr("id");
			longTermDoctorListModel.removeAttr("hidden");
			//基础信息
		
			longTermDoctorListModel.find(".patientName").html(doctorAdviceStandingRecord.patientName);
			longTermDoctorListModel.find(".deptName").html(doctorAdviceStandingRecord.deptName);
			longTermDoctorListModel.find(".bedName").html(doctorAdviceStandingRecord.bedName);
			longTermDoctorListModel.find(".patientId").html(doctorAdviceStandingRecord.patientId);
			longTermDoctorListModel.find(".mrId").html(doctorAdviceStandingRecord.mrId);
			longTermDoctorListModel.find(".indexNumber").html(num);
			//循环医嘱信息
			var doctorAdviceStandingItems=doctorAdviceStandingRecord.doctorAdviceStandingItems;
			var longTermDoctorListTableModel=longTermDoctorListModel.find("#longTermDoctorListTableModel");
			longTermDoctorListTableModel.removeAttr("id");
			for(var itemsIndex in doctorAdviceStandingItems){
				var doctorAdviceStandingItem=doctorAdviceStandingItems[itemsIndex];
				var doctorListContent=longTermDoctorListTableModel.find("#doctorListContent").clone();
				doctorListContent.removeAttr("hidden");
				doctorListContent.removeAttr("id");
				if(doctorAdviceStandingItem.doctorAdviceStartDateTime=="" || doctorAdviceStandingItem.doctorAdviceStartDateTime==null || typeof doctorAdviceStandingItem.doctorAdviceStartDateTime==undefined){
					doctorListContent.find(".doctorAdviceStartDate").html("");
					doctorListContent.find(".doctorAdviceStartTime").html("");
				}else{
					doctorListContent.find(".doctorAdviceStartDate").html(doctorAdviceStandingItem.doctorAdviceStartDateTime.substring(2,10));
					doctorListContent.find(".doctorAdviceStartTime").html(doctorAdviceStandingItem.doctorAdviceStartDateTime.substring(11,16));
				}
				
				doctorListContent.find(".doctorAdviceContent").html(doctorAdviceStandingItem.doctorAdviceContent);
				doctorListContent.find(".doctorAdviceStartDoctorName").html(doctorAdviceStandingItem.doctorAdviceStartDoctorName);
				doctorListContent.find(".doctorAdviceStartNurseName").html(doctorAdviceStandingItem.doctorAdviceStartNurseName);
				if(doctorAdviceStandingItem.doctorAdviceEndDateTime=="" || doctorAdviceStandingItem.doctorAdviceEndDateTime==null || typeof doctorAdviceStandingItem.doctorAdviceEndDateTime==undefined){
					doctorListContent.find(".doctorAdviceEndDate").html("");
					doctorListContent.find(".doctorAdviceEndTime").html("");
				}else{
					doctorListContent.find(".doctorAdviceEndDate").html(doctorAdviceStandingItem.doctorAdviceEndDateTime.substring(5,10));
					doctorListContent.find(".doctorAdviceEndTime").html(doctorAdviceStandingItem.doctorAdviceEndDateTime.substring(11,16));
				}
				
				doctorListContent.find(".doctorAdviceEndDoctorName").html(doctorAdviceStandingItem.doctorAdviceEndDoctorName);
				doctorListContent.find(".doctorAdviceEndNurseName").html(doctorAdviceStandingItem.doctorAdviceEndNurseName);
				longTermDoctorListTableModel.find("tbody").append(doctorListContent);
			}
			
			$("#longTermDoctorList").append(longTermDoctorListModel);
			
			}
	}
	
	function examinationReportsInfo(data){
		var examinationReportsRecord=data.examinationReportsRecords;
		var html="<tr>"+
						"<td style='width: 244px;border: none;padding-left: 15px;'>"+
							"<label style='width: 240px;'>姓&nbsp;名:<span>"+examinationReportsRecord[0].patientName+"</span></label>"+
							"<label style='width: 240px;'>性&nbsp;别:<span>"+examinationReportsRecord[0].sexName+"</span></label>"+
							"<label style='width: 240px;'>年&nbsp;龄:<span>"+examinationReportsRecord[0].ageName+"</span></label>"+
							"<label style='width: 240px;'>病&nbsp;案:<span>"+examinationReportsRecord[0].mrId+"</span></label>"+
						"</td>"+
						"<td style='width: 244px;border: none;'>"+
							"<label style='width: 250px;'>科&nbsp;别:<span>"+examinationReportsRecord[0].deptCategoryName+"</span></label>"+
							"<label style='width: 250px;'>床&nbsp;位:<span>"+examinationReportsRecord[0].bedName+"</span></label>"+
							"<label style='width: 250px;'>费&nbsp;别:<span>"+examinationReportsRecord[0].costName+"</span></label>"+
							"<label style='width: 250px;'>送检医师:<span>"+examinationReportsRecord[0].submittingPhysicianName+"</span></label>"+
						"</td>"+
						"<td style='width: 244px;border: none;'>"+
							"<label style='width: 240px;'>样本编号<span>"+examinationReportsRecord[0].specimenCode+"</span></label>"+
							"<label style='width: 240px;'>条码编号:<span>"+examinationReportsRecord[0].barCode+"</span></label>"+
							"<label style='width: 240px;'>标本种类:<span>"+examinationReportsRecord[0].specimenTypeName+"</span></label>"+
							"<label style='width: 240px;'>临床诊断:<span>"+examinationReportsRecord[0].clinicalDiagnosisName+"</span></label>"+
						"</td>"+
					"</tr>";
		$("#examinationReportstitle").html(html);
	}
	
	function addReportsRecord(reportsInfo){
		var reportsRecords=reportsInfo.examinationReportsRecords;
		for(var index in reportsRecords){
			var reportsRecord=reportsRecords[index];
			var add_content=$("#reportsRecordTemplate").clone();
			add_content.removeAttr("id");
			add_content.find(".patientName").html(reportsRecord.patientName);
			add_content.find(".sexName").html(reportsRecord.sexName);
			add_content.find(".ageName").html(reportsRecord.ageName);
			add_content.find(".mrId").html(reportsRecord.mrId);
			add_content.find(".deptCategoryName").html(reportsRecord.deptCategoryName);
			add_content.find(".bedName").html(reportsRecord.bedName);
			add_content.find(".costName").html(reportsRecord.costName);
			add_content.find(".submittingPhysicianName").html(reportsRecord.submittingPhysicianName);
			add_content.find(".specimenCode").html(reportsRecord.specimenCode);
			add_content.find(".barCode").html(reportsRecord.barCode);
			add_content.find(".specimenTypeName").html(reportsRecord.specimenTypeName);
			add_content.find(".clinicalDiagnosisName").html(reportsRecord.clinicalDiagnosisName);
			add_content.find(".samplingDateTime").html(reportsRecord.samplingDateTime);
			add_content.find(".inspectDateTime").html(reportsRecord.inspectDateTime);
			add_content.find(".inspectionDoctorName").html(reportsRecord.inspectionDoctorName);
			add_content.find(".acceptanceCheckDateTime").html(reportsRecord.acceptanceCheckDateTime);
			add_content.find(".reportDateTime").html(reportsRecord.reportDateTime);
			add_content.find(".auditorDoctorName").html(reportsRecord.auditorDoctorName);
			add_content.find(".remark").html(reportsRecord.remark);
			add_content.removeAttr("hidden");
			var reportItems=reportsRecord.examinationReportsItems;
			var reportsRecordTable= add_content.find("#reportsRecordTableTemplate");
		    reportsRecordTable.removeAttr("id");
		    var itemCount=0;
			for(var itemIndex in reportItems){
				var reportItem=reportItems[itemIndex];
				itemCount++;
			    var addItem = reportsRecordTable.find("#reportItemTrTemplate").clone();
			    addItem.removeAttr("id");
			    addItem.removeAttr("hidden");
			    addItem.find(".index").html(itemCount);
			    addItem.find(".projectName").html(reportItem.projectName);
			    addItem.find(".examinationResult").html(reportItem.examinationResult);
			    addItem.find(".examinationUnit").html(reportItem.examinationUnit);
			    addItem.find(".referenceValues").html(reportItem.referenceValues);
			    
			   reportsRecordTable.find("tbody").append(addItem);
			}
			
		   
			$("#reportsRecords").append(add_content);
		}
		
	}
